import React from 'react'
import subject from '@/assets/images/home/subject.png'
import './Subject.less'
import Button from '@material-ui/core/Button';
import { useHistory } from 'react-router-dom';
export default function Subject(props) {
    const history = useHistory()
    const gotoPractice = () => {
        history.push(`/sq/${props.data.actionCode}`)
    }
    return (
        <div className="subject-list-item">
            <div className="subject">
                <img src={subject} alt="" />
            </div>
            <div className="info">
                <h3>{props.data.title}</h3>
            </div>
            <Button variant="contained" color="primary" onClick={gotoPractice}>
                刷题
            </Button>
        </div>
    )
}
